package com.wanmait.demo.webcontroller.usercontroller;

import com.wanmait.demo.pojo.District;
import com.wanmait.demo.service.DistrictService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DistrictController {
@Resource
private DistrictService districtService;
    //查询服务范围//尹山坤
    @RequestMapping("/addresspager")
    public String addresspager(){
        return "user/ysk/address";
    }


    @RequestMapping("/alldistrict")  //尹山坤
    public ModelAndView alldistrict(){
        ModelAndView modelAndView=new ModelAndView();
        List<District> districts=districtService.selectalldistrict();
        modelAndView.addObject("districts",districts);
        modelAndView.setViewName("user/ysk/repair");

        return modelAndView;

    }


    @RequestMapping("/address")
    public ModelAndView address(){
        ModelAndView modelAndView=new ModelAndView();
        List<District> districts=districtService.selectalldistrict();
        modelAndView.addObject("districts",districts);

        modelAndView.setViewName("user/ysk/address");
        return modelAndView;

    }






}
